package com.qf.fmall2204.shiro;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyFilterConfig {

    @Bean
    public FilterRegistrationBean<TokenFilter> tokenFilterFilterRegistrationBean(TokenFilter tokenFilter){

        FilterRegistrationBean<TokenFilter> registrationBean = new FilterRegistrationBean<>();

        registrationBean.setFilter(tokenFilter);

        // 不让该filter出现在全局过滤器链中
        registrationBean.setEnabled(false);

        return registrationBean;

    }

}
